<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>  
<%@include file="/WEB-INF/content/public/head.jsp" %>
<title><s:text name="system.name" /></title>  
<link href="${ctx}/css/login.css" rel="stylesheet" type="text/css" /> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<script type="text/javascript"> 
$(document).ready(function(){	
	$("#loginForm").safform({
        ajaxurl:"${ctx}/core/staff.doLogin.do",
		tiptype:2,
		submittype:2,
		callback:function(data,url){  
			$.Hidemsg(); //公用方法关闭信息提示框;
			$.safdialog("close_dialog");
			//这里执行回调操作;	  
			if(data.returncode==0){ 
				window.location.href="${ctx}/contentRoot/main.do";				
			}else{  
				$.safdialog({isModel:false,"info":data.errmsg,"showTime":1000,level:1});  
				reflashImg();
			}
		}
	});  
			
	$("body").ajaxError(function(event,request, settings,thrownError){
		alert("错误信息:"+thrownError);
	});
	
	$("#loginName").keydown(key13Down); 
	$("#passWord").keydown(key13Down); 
	
	$('#language>option').each(function(){
		if(this.value=='${WW_TRANS_I18N_LOCALE}'){
			this.selected = true;
		}else{
			this.selected = false;
		}
	});
	
	reflashImg();       
});
 

//回车焦点
function key13Down(e){ 
	var curKey = e.which; 
	if(curKey == 13){ 
		$("#loginForm").submit();
		return false; 
	} 
}
  
function reflashImg(){ 
	$('#imgValidcode').attr("src","${ctx}/core/imageCode.getCode.do?r"+ new Date().getTime()); 
}

function changeLanguage(){
	$('#request_locale').val($('#language').val());
	$('#loginForm')[0].submit();
}
 
</script>
</head>

<body>
<form id="loginForm" method="post">
<input type="hidden" name="request_locale" id="request_locale" value='zh'/>  
<div id="wrap"> 
	<div id="header"> </div>
    <div id="content-wrap">  
    	 <div class="space"> 
    	 </div>
    	<div class="content"> 
    	 <div class="logo">
    	 </div>
    	 <div class="inputArea"> 
    	      <div class="field"><label><s:text name="lable.login.name" />：</label>
    	        <input type="text" name="staff.query_EQ_loginName" id="query_EQ_loginName" datatype="^.{2,20}$" nullmsg="<s:text name="login.name.null.info"/>" errormsg="" passinfo="null" maxlength="20"/><span class="Validform_checktip"></span>
       		 </div>
       		 <div class="field"><label><s:text name="lable.user.pwd" />：</label>
       		    <input class="password" type="password" name="staff.passWord" id="passWord" datatype="*" nullmsg="<s:text name="password.null.info"/>" errormsg="" passinfo="null"/><span class="Validform_checktip"></span>
    	 	 </div>
    	 	 <div class="field"><label><s:text name="lable.validcode" />：</label>
    	 	   <input class="captcha" type="text" name="validcode" id="validcode" datatype="^.{2,20}$" nullmsg="<s:text name="validcode.null.info"/>" errormsg="" passinfo="null" maxlength="4"/>
    	 	   &nbsp;
    	 	   <img id="imgValidcode"  onclick="reflashImg()"/><span class="Validform_checktip"></span>
             </div>
         </div>
         <div class="spacelanguage"></div>
         <div class="changelanguage"> 
             <label><s:text name="lable.select.language" />：</label>
             <dict:dictTag controlType="1" name="chooseLan" id="language" dictType="language" showTip="false" onchange="changeLanguage()"></dict:dictTag>
         </div>
         <div class="btn">
            <input name="" type="submit" class="login-btn" value="<s:text name='btn.login' />" />
         </div> 
		</div> 
    </div>
</div>  
</form> 
</body>
</html>
